<!DOCTYPE html>
</head>
<body>
<div style="" id="data"></div>
<th:block th:include="include :: footer" />
<script th:src="@{/ocean/js/base64.js}"></script>
<script>
    var filePath = "[[${filePath}]]";//文件名称路径
    var path = "http://116.204.52.153:8012";
    var http = "http://"
    var domain = window.location.host;
    console.log(filePath)
    var prefix ="/leaflet/map";
    $.modal.loading("正在加载，请稍后...");
    $.post(prefix + "/gettardata",{filePath:filePath}, function (data) {
        console.log(data)
        if(data.code==500){
            $.modal.closeLoading();
            $.modal.msgWarning("解压文件错误");
        }else{
        var html = "";
        for (let i = 0; i < data.data.length; i++) {
            var namehz =data.data[i].substring(data.data[i].length-5,data.data[i].length)
            if(namehz.includes("txt")){
                var s = data.data[i]
                    html += "<div style='width: 100%;display: flex;" +
                        "  align-items: center; " +
                        "  justify-content: center; " +
                        "  height: 20px; '>" +
                        "<svg t=\"1736389405466\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8854\" width=\"30\" height=\"30\"><path d=\"M490.23 221.699l-47.125-49.852c-13.802-14.603-32.937-22.868-52.943-22.868H186.101c-40.402 0-73.153 33.035-73.153 73.786v548.08c0 40.75 32.751 73.786 73.153 73.786h653.697c40.398 0 73.15-33.037 73.15-73.786V318.351c0-40.75-32.751-73.784-73.15-73.784H543.174c-20.006 0-39.137-8.266-52.944-22.868z\" fill=\"#FFA820\" p-id=\"8855\"></path><path d=\"M194.029 148.979h-7.927c-40.402 0-73.153 33.035-73.153 73.786v14.772a447.71 447.71 0 0 1 81.08-88.558zM912.948 318.351c0-37.143-27.214-67.863-62.623-73.013 29.014 43.751 50.506 92.923 62.623 145.675v-72.662zM912.948 770.845V591.186c-23.546 102.506-82.474 191.504-163.244 253.445h90.094c40.399 0 73.15-33.036 73.15-73.786zM112.948 744.662v26.183c0 40.75 32.751 73.786 73.153 73.786h22.181a447.815 447.815 0 0 1-95.334-99.969z\" fill=\"#FEAC33\" p-id=\"8856\"></path><path d=\"M249.061 148.979h-55.033a447.77 447.77 0 0 0-81.08 88.558v67.603c30.328-63.67 77.652-117.683 136.113-156.161zM112.948 635.199v109.464a447.814 447.814 0 0 0 95.334 99.969H373.53c-115.336-26.537-210.833-104.989-260.582-209.433zM912.948 591.186V391.013c-12.117-52.753-33.609-101.924-62.623-145.675a73.1 73.1 0 0 0-10.527-0.772h-68.696c46.026 63.352 73.174 141.306 73.174 225.603 0 182.464-127.183 335.221-297.734 374.462h203.162c80.77-61.941 139.699-150.939 163.244-253.445z\" fill=\"#FEB133\" p-id=\"8857\"></path><path d=\"M844.277 470.169c0-84.297-27.148-162.251-73.174-225.603h-79.854c45.655 55.738 73.06 127.002 73.06 204.672 0 178.515-144.715 323.23-323.23 323.23S117.85 627.753 117.85 449.238c0-136.162 84.199-252.646 203.366-300.26h-72.154C190.6 187.457 143.276 241.47 112.948 305.14v330.058c49.749 104.444 145.246 182.896 260.581 209.432h173.013c170.552-39.239 297.735-191.997 297.735-374.461z\" fill=\"#FEB633\" p-id=\"8858\"></path><path d=\"M117.849 449.239c0 178.515 144.715 323.23 323.229 323.23s323.23-144.715 323.23-323.23c0-77.67-27.405-148.935-73.06-204.672h-82.076c46.483 47.315 75.167 112.174 75.167 183.742 0 144.819-117.399 262.219-262.219 262.219s-262.218-117.4-262.218-262.219 117.4-262.219 262.219-262.219c5.179 0 10.318 0.167 15.423 0.463-13.161-11.289-29.94-17.575-47.382-17.575h-68.947c-119.166 47.615-203.366 164.1-203.366 300.261z\" fill=\"#FFBC34\" p-id=\"8859\"></path><path d=\"M159.902 428.309c0 144.819 117.399 262.219 262.219 262.219s262.219-117.4 262.219-262.219c0-71.568-28.684-136.427-75.167-183.742h-65.998c-20.007 0-39.137-8.266-52.944-22.868l-47.125-49.852a73.533 73.533 0 0 0-5.56-5.293 266.288 266.288 0 0 0-15.423-0.463c-144.821-0.001-262.221 117.399-262.221 262.218z m444.469-20.93c0 111.124-90.084 201.208-201.208 201.208s-201.208-90.084-201.208-201.208 90.084-201.208 201.208-201.208 201.208 90.084 201.208 201.208z\" fill=\"#FFC134\" p-id=\"8860\"></path><path d=\"M201.956 407.379c0 111.124 90.084 201.208 201.208 201.208s201.208-90.084 201.208-201.208-90.084-201.208-201.208-201.208-201.208 90.084-201.208 201.208z m322.447-20.931c0 77.429-62.768 140.197-140.197 140.197s-140.197-62.768-140.197-140.197 62.768-140.197 140.197-140.197 140.197 62.769 140.197 140.197z\" fill=\"#FFC634\" p-id=\"8861\"></path><path d=\"M384.206 386.448m-140.197 0a140.197 140.197 0 1 0 280.394 0 140.197 140.197 0 1 0-280.394 0Z\" fill=\"#FFCB34\" p-id=\"8862\"></path><path d=\"M390.162 166.979c14.982 0 29.511 6.281 39.862 17.233l47.127 49.854c17.127 18.113 41.191 28.501 66.023 28.501h296.624c30.41 0 55.15 25.025 55.15 55.784v452.494c0 30.761-24.74 55.786-55.15 55.786H186.101c-30.411 0-55.153-25.026-55.153-55.786v-548.08c0-30.761 24.742-55.786 55.153-55.786h204.061m0-18H186.101c-40.402 0-73.153 33.035-73.153 73.786v548.08c0 40.75 32.751 73.786 73.153 73.786h653.697c40.398 0 73.15-33.037 73.15-73.786V318.351c0-40.75-32.751-73.784-73.15-73.784H543.175c-20.007 0-39.137-8.266-52.944-22.868l-47.125-49.852c-13.803-14.604-32.938-22.868-52.944-22.868z\" fill=\"#FFA820\" p-id=\"8863\"></path><path d=\"M130.935 353.465h556.523c19.21 0 34.781 15.572 34.781 34.783v139.13c0 19.209-15.57 34.783-34.781 34.783H130.935V353.465z\" fill=\"#FFE3B4\" p-id=\"8864\"></path><path d=\"M379.302 226.171h-124.12c-9.941 0-18-8.059-18-18s8.059-18 18-18h124.12c9.941 0 18 8.059 18 18s-8.059 18-18 18z\" fill=\"#FFFFFF\" p-id=\"8865\"></path><path d=\"M195.246 226.171H184.7c-9.941 0-18-8.059-18-18s8.059-18 18-18h10.545c9.941 0 18 8.059 18 18s-8.058 18-17.999 18z\" fill=\"#FFFFFF\" p-id=\"8866\"></path></svg>" +
                        '<a style=\'color: #0b88fd\' onclick="show(\''+data.data[i]+'\')">'+data.data[i]+'</a></div><br>'
            }else{
                html += "<div style='width: 100%;display: flex;\n" +
                    "  align-items: center; /* 垂直居中 */\n" +
                    "  justify-content: center; /* 水平居中，如果需要的话 */\n" +
                    "  height: 20px; /* 假设您想要在整个视口高度内居中，可以根据需要调整高度 */ '>" +
                    "<svg t=\"1736389405466\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"8854\" width=\"30\" height=\"30\"><path d=\"M490.23 221.699l-47.125-49.852c-13.802-14.603-32.937-22.868-52.943-22.868H186.101c-40.402 0-73.153 33.035-73.153 73.786v548.08c0 40.75 32.751 73.786 73.153 73.786h653.697c40.398 0 73.15-33.037 73.15-73.786V318.351c0-40.75-32.751-73.784-73.15-73.784H543.174c-20.006 0-39.137-8.266-52.944-22.868z\" fill=\"#FFA820\" p-id=\"8855\"></path><path d=\"M194.029 148.979h-7.927c-40.402 0-73.153 33.035-73.153 73.786v14.772a447.71 447.71 0 0 1 81.08-88.558zM912.948 318.351c0-37.143-27.214-67.863-62.623-73.013 29.014 43.751 50.506 92.923 62.623 145.675v-72.662zM912.948 770.845V591.186c-23.546 102.506-82.474 191.504-163.244 253.445h90.094c40.399 0 73.15-33.036 73.15-73.786zM112.948 744.662v26.183c0 40.75 32.751 73.786 73.153 73.786h22.181a447.815 447.815 0 0 1-95.334-99.969z\" fill=\"#FEAC33\" p-id=\"8856\"></path><path d=\"M249.061 148.979h-55.033a447.77 447.77 0 0 0-81.08 88.558v67.603c30.328-63.67 77.652-117.683 136.113-156.161zM112.948 635.199v109.464a447.814 447.814 0 0 0 95.334 99.969H373.53c-115.336-26.537-210.833-104.989-260.582-209.433zM912.948 591.186V391.013c-12.117-52.753-33.609-101.924-62.623-145.675a73.1 73.1 0 0 0-10.527-0.772h-68.696c46.026 63.352 73.174 141.306 73.174 225.603 0 182.464-127.183 335.221-297.734 374.462h203.162c80.77-61.941 139.699-150.939 163.244-253.445z\" fill=\"#FEB133\" p-id=\"8857\"></path><path d=\"M844.277 470.169c0-84.297-27.148-162.251-73.174-225.603h-79.854c45.655 55.738 73.06 127.002 73.06 204.672 0 178.515-144.715 323.23-323.23 323.23S117.85 627.753 117.85 449.238c0-136.162 84.199-252.646 203.366-300.26h-72.154C190.6 187.457 143.276 241.47 112.948 305.14v330.058c49.749 104.444 145.246 182.896 260.581 209.432h173.013c170.552-39.239 297.735-191.997 297.735-374.461z\" fill=\"#FEB633\" p-id=\"8858\"></path><path d=\"M117.849 449.239c0 178.515 144.715 323.23 323.229 323.23s323.23-144.715 323.23-323.23c0-77.67-27.405-148.935-73.06-204.672h-82.076c46.483 47.315 75.167 112.174 75.167 183.742 0 144.819-117.399 262.219-262.219 262.219s-262.218-117.4-262.218-262.219 117.4-262.219 262.219-262.219c5.179 0 10.318 0.167 15.423 0.463-13.161-11.289-29.94-17.575-47.382-17.575h-68.947c-119.166 47.615-203.366 164.1-203.366 300.261z\" fill=\"#FFBC34\" p-id=\"8859\"></path><path d=\"M159.902 428.309c0 144.819 117.399 262.219 262.219 262.219s262.219-117.4 262.219-262.219c0-71.568-28.684-136.427-75.167-183.742h-65.998c-20.007 0-39.137-8.266-52.944-22.868l-47.125-49.852a73.533 73.533 0 0 0-5.56-5.293 266.288 266.288 0 0 0-15.423-0.463c-144.821-0.001-262.221 117.399-262.221 262.218z m444.469-20.93c0 111.124-90.084 201.208-201.208 201.208s-201.208-90.084-201.208-201.208 90.084-201.208 201.208-201.208 201.208 90.084 201.208 201.208z\" fill=\"#FFC134\" p-id=\"8860\"></path><path d=\"M201.956 407.379c0 111.124 90.084 201.208 201.208 201.208s201.208-90.084 201.208-201.208-90.084-201.208-201.208-201.208-201.208 90.084-201.208 201.208z m322.447-20.931c0 77.429-62.768 140.197-140.197 140.197s-140.197-62.768-140.197-140.197 62.768-140.197 140.197-140.197 140.197 62.769 140.197 140.197z\" fill=\"#FFC634\" p-id=\"8861\"></path><path d=\"M384.206 386.448m-140.197 0a140.197 140.197 0 1 0 280.394 0 140.197 140.197 0 1 0-280.394 0Z\" fill=\"#FFCB34\" p-id=\"8862\"></path><path d=\"M390.162 166.979c14.982 0 29.511 6.281 39.862 17.233l47.127 49.854c17.127 18.113 41.191 28.501 66.023 28.501h296.624c30.41 0 55.15 25.025 55.15 55.784v452.494c0 30.761-24.74 55.786-55.15 55.786H186.101c-30.411 0-55.153-25.026-55.153-55.786v-548.08c0-30.761 24.742-55.786 55.153-55.786h204.061m0-18H186.101c-40.402 0-73.153 33.035-73.153 73.786v548.08c0 40.75 32.751 73.786 73.153 73.786h653.697c40.398 0 73.15-33.037 73.15-73.786V318.351c0-40.75-32.751-73.784-73.15-73.784H543.175c-20.007 0-39.137-8.266-52.944-22.868l-47.125-49.852c-13.803-14.604-32.938-22.868-52.944-22.868z\" fill=\"#FFA820\" p-id=\"8863\"></path><path d=\"M130.935 353.465h556.523c19.21 0 34.781 15.572 34.781 34.783v139.13c0 19.209-15.57 34.783-34.781 34.783H130.935V353.465z\" fill=\"#FFE3B4\" p-id=\"8864\"></path><path d=\"M379.302 226.171h-124.12c-9.941 0-18-8.059-18-18s8.059-18 18-18h124.12c9.941 0 18 8.059 18 18s-8.059 18-18 18z\" fill=\"#FFFFFF\" p-id=\"8865\"></path><path d=\"M195.246 226.171H184.7c-9.941 0-18-8.059-18-18s8.059-18 18-18h10.545c9.941 0 18 8.059 18 18s-8.058 18-17.999 18z\" fill=\"#FFFFFF\" p-id=\"8866\"></path></svg>" +
                    "<p>"+data.data[i]+"</p></div><br>"
            }
        }
        $.modal.closeLoading();
        $("#data").html(html)
        }
    })
    //展示压缩包里的txt
    function show(data){
        console.log(data)
        console.log(filePath)
        $.post(prefix + "/gettartxt",{filePath:filePath,path:data}, function (data) {
            if(data.code==0){
                let strings = data.msg.split("cloud");
                var url = http + domain + '/cloud' + strings[1]
                let replacedStr = url.replace(/\\/g, '/');
                $.modal.openOptions({
                    title: '预览',
                    url: path + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(replacedStr)),
                    width: "1400",
                    height: "900",
                    showButtonPanel: false,
                    btn: ['关闭'],
                    yes: function (index, layero) {
                        $.modal.close(index);//使用layer.close(index);无效
                    },
                    cancel: function (index, layero) {
                        $.modal.close(index);
                    }
                });
            }else{
                $.modal.msgWarning("展示错误");
            }
        })
    }
</script>
</body>
</html>
